// Copyright (C) ZHENG Zhong <heavyzheng nospam-at gmail D0T com>
//
// $Id: function_detail.hpp 216 2008-09-03 08:13:29Z heavyzheng $
//

#ifndef ZZHENG_LOGGING_FUNCTION_DETAIL_HPP_20080902__
#define ZZHENG_LOGGING_FUNCTION_DETAIL_HPP_20080902__

#include <zzheng/logging/config.hpp>
#include <zzheng/logging/basic_log_factory.hpp>
#include <zzheng/logging/basic_logger.hpp>

#include <string>

namespace zzheng {
namespace logging {
namespace detail {

    template<class Factory>
    inline
    basic_logger<Factory> get_root_logger() {
        basic_log_factory<Factory>& factory = basic_log_factory<Factory>::instance();
        return factory.get_root();
    }

    template<class Factory>
    inline
    basic_logger<Factory> get_logger(const std::string& name) {
        basic_log_factory<Factory>& factory = basic_log_factory<Factory>::instance();
        basic_logger<Factory> root_logger = factory.get_root();
        return root_logger.child(name);
    }

} // namespace zzheng::logging::detail
} // namespace zzheng::logging
} // namespace zzheng


#endif // ZZHENG_LOGGING_FUNCTION_DETAIL_HPP_20080902__


